package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 权益类型
 *
 * @Author：LiGen
 * @Package：com.sc.nft.enums
 * @Project：sc_metago
 * @name：equityTypeEnum
 * @Date：2024/4/7 13:40
 * @Filename：equityTypeEnum
 */
@AllArgsConstructor
@Getter
public enum EquityTypeEnum {

    DISCOUNT_COUPON(1, "优惠券"),
    COMMODITY(2, "商品"),
    ;

    @EnumValue
    private Integer code;

    private String desc;

    public static EquityTypeEnum getEnumByMallMemberEquityTypeEnum(MallMemberEquityTypeEnum typeEnum) {
        if (MallMemberEquityTypeEnum.getCommodityList().contains(typeEnum)) {
            return COMMODITY;
        } else if (MallMemberEquityTypeEnum.getCouponList().contains(typeEnum)) {
            return DISCOUNT_COUPON;
        } else {
            return null;
        }
    }
}
